home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1987 August
/
Ahoy_Magazine_87-08_1987_Double_L_Side_A.d64
/
Polygon Play
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
628b
|
22 lines
0 poke646,0:poke53280,12:poke53281,12
1 rem ==================================
2 rem commodares problem #40-3 :
3 rem polygon play
4 rem solution by
5 rem joe steininger
6 rem ==================================
10 print"[147]how many sides"
20 input n:if n<3 goto 20
30 print"length of each side, in meters"
40 input l
50 a=((n-2)/n)*180
60 s=a*n
70 r=(l/2)*(1/tan((NULL)/n))
80 d=(l/2)*(1/sin((NULL)/n))
90 y=n*(l^2)/4*(1/tan((NULL)/n))
100 print"interior angles are ";a;"degrees each":print
110 print"sum of interior angles is ";s;"degrees":print
120 print"the area is ";y;"square meters":print
130 print"inscribed radius is ";r;"meters":print
140 print"circumscribed radius is ";d;"meters":print:print